package com.yjc.spring.boot.starter;

import com.yjc.spring.boot.config.ClassConfig;
import com.yjc.spring.boot.listener.DynamicClassUnloadListener;
import com.yjc.spring.boot.postprocessor.ClassHolderBeanFactoryPostProcessor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自动配置类
 *
 * @author 闫佳成
 * @version: 1.0
 * @since 2024/10/9 18:02
 */
@Configuration
@EnableConfigurationProperties
public class SpringBootClassHolderAutoConfiguration {

    @Bean
    public ClassHolderBeanFactoryPostProcessor classHolderPostProcessor(){
        return new ClassHolderBeanFactoryPostProcessor();
    }

    @Bean
    public DynamicClassUnloadListener dynamicClassUnloadListener(){
        return new DynamicClassUnloadListener();
    }
}
